<style>
#vn3d-option-search {
 	display: none;
}
</style>
<script>
$(document).ready(function(){
$(".panel-heading").click(function(){
	console.log("ckic");
	$("#vn3d-option-search").toggle("slow");
});

$("#vn3d-btn-search").click(function(){
var typesearch=$("#vn3d-type-search").val();
var query=$("#vn3d-query").val();
var searchname=$(".vn3d-search-in")[0].checked?"y":"n";
var searchshortdesc=$(".vn3d-search-in")[1].checked?"y":"n";
var searchdesc=$(".vn3d-search-in")[2].checked?"y":"n";
var searchkeyword=$(".vn3d-search-in")[3].checked?"y":"n";
var searchinsubcat=$("#search-in-subcat").checked?"y":"n";
var category=$("#vn3d-category").val();
var productcode=$("#vn3d-product-code").val();
var pricefrom=$("#vn3d-price-from").val();
var priceto=$("#vn3d-price-to").val();
var lbsfrom=$("#vn3d-lbs-from").val();
var lbsto=$("#vn3d-lbs-to").val();


currentUrl=currentUrl.split("?")[0]+"?q="+query+"&typesearch="+typesearch
+"&searchname="+searchname+"&searchshortdesc="+searchshortdesc
+"&searchdesc="+searchdesc+"&searchkeyword="+searchkeyword
+"&searchinsubcat="+searchinsubcat+"&searchinsubcat="+searchinsubcat
+"&category="+category+"&productcode="+productcode
+"&pricefrom="+pricefrom+"&priceto="+priceto
+"&lbsfrom="+lbsfrom+"&lbsto="+lbsto;
loadProducts();


});
});
</script>
<ol id="breadcrumb" class="breadcrumb">
	<li><a href="/store">Home</a></li>
	<li class="active"><a>Search results</a></li>
</ol>


<div class="col-md-12">
	<div class="col-md-9 pull-left">
		<h2>Search results</h2>
	</div>
	<div class="col-md-3 pull-left">
		<h5>Products found: <?php echo $totalProduct;?></h5>
	</div>
</div>



<div class="pull-left panel panel-primary" style="width: 100%">
	<div class="panel-heading">
		<h5 class="panel-title">
			Search options<span
				class="vn3d-toggle glyphicon glyphicon-plus pull-right"></span><span
				class="pull-right vn3d-toggle" style="margin-right: 10px">Open </span>
		</h5>

	</div>
	<div id="vn3d-option-search" class="col-md-12">
		<form role="form">
			<div class="row">
				<div class="col-md-12">
					<label>Find results with</label>
				</div>
				<div class="col-md-4">
					<select  id="vn3d-type-search"  class="form-control">
						<option value="any">Any of these words</option>
						<option selected="selected" value="all">All of these words</option>
						<option value="exact">The exact phrase</option>
					</select>
				</div>
				<div class="col-md-8">
					<input id="vn3d-query" type="text" class="form-control" placeholder="" value="<?php echo $q;   ?>">
				</div>
			</div>

			<div class="form-group">
				<label>Search in</label>
			</div>
			<div class="checkbox">
				<label> <input type="checkbox" class="vn3d-search-in"
					value="PRODUCT_NAME" checked="checked"> Product name
				</label>
			</div>
			<div class="checkbox">
				<label> <input class="vn3d-search-in" type="checkbox" value="SHORT_DESC" checked="checked">
					Short description
				</label>
			</div>
			<div class="checkbox">
				<label> <input class="vn3d-search-in" type="checkbox" value="FULL_DESC" checked="checked">
					Full description
				</label>
			</div>
			<div class="checkbox">
				<label> <input class="vn3d-search-in" type="checkbox" value="KEYWORD" checked="checked">
					Keywords
				</label>
			</div>
			<div class="row">


				<div class="col-md-12">
					<label>Search in category</label>
				</div>
				<div class="col-md-4">
					<select id="vn3d-category" class="form-control">


						<?php

$k = 1;
foreach ($menu as $key => $category) {
    if (empty($category['parent_id'])) {

        ?>
<option  value="<?php echo $category['id'];?>"><?php echo $category['name']?></option>

<?php
    }else {

?>
<option  value="<?php echo $category['id'];?>">--<?php echo $category['name']?></option>

<?php
}
}
?>
					</select>
				</div>
				<div class="col-md-8">
					<div class="checkbox">
						<label> <input id="search-in-subcat" type="checkbox" checked="checked"> Search in
							subcategories
						</label>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label>Advanced search options</label>

			</div>
			<div class="form-group">
				<label>Search by product code</label> <input id="vn3d-product-code" style="width: 240px"
					type="text" class="form-control" placeholder="Product code">
			</div>
			<div class="row">
				<div class="col-md-12">
					<label for="exampleInputPassword1">Search by price ($)</label>
				</div>
				<div class="col-md-5">
					<input id="vn3d-price-from" type="number" class="form-control" placeholder="from">
				</div>
				<div class="col-md-5">
					<input id="vn3d-price-to" type="number" class="form-control" placeholder="to">
				</div>
			</div>
			<div class="row">

				<div class="col-md-12">
					<label>Search by weight (lbs)</label>
				</div>
				<div class="col-md-5">
					<input id="vn3d-lbs-from" type="text" class="form-control" placeholder="">
				</div>
				<div class="col-md-5">
					<input id="vn3d-lbs-to" type="text" class="form-control" placeholder="">
				</div>
			</div>
			<br>


			<a id="vn3d-btn-search" class="btn btn-default">SEARCH</a>
		</form>


	</div>
</div>
